home *** CD-ROM | disk | FTP | other *** search
- #include <Gestalt.h>
- #include <DCon.h>
- #include <QuickDraw.h>
- #include <MixedMode.h>
- #include <A4Stuff.h>
- #include <ControlStrip.h>
-
- #include "DockStrip.h"
-
- ProcInfoType __procinfo = sdevMain_ProcInfo;
-
- SdevMainProcPtr gCallThroughSdevMain = (SdevMainProcPtr) 0xDEADBEEF;
- SDockStripGlobals* gGlobalsPtr = nil;
-
- pascal long main (
- unsigned long message,
- Handle prefsHandle,
- Rect *statusRect,
- GrafPtr statusPort)
- {
- Rect copy;
- long result;
- Boolean runModule;
-
- static Boolean gotIndex = false;
- static UInt32 index;
-
- if (gGlobalsPtr == nil) {
- Gestalt (dockStripGestalt, (SInt32*)&gGlobalsPtr);
- }
- if (gGlobalsPtr == nil) {
- DebugStr ("\pGlobals not found in Gestalt");
- }
-
- // DebugStr ("\pSdev stub frag main");
-
- if (!gotIndex) {
- gCallThroughSdevMain = (SdevMainProcPtr) message;
- for (index = 0; index < StubListSize; index++) {
- if (gGlobalsPtr -> moduleList [index].module.procPtr == (ProcPtr) gCallThroughSdevMain) {
- gotIndex = true;
- return 0;
- }
- }
- }
-
- if (!gotIndex) {
- DebugStr ("\pModule not found in the list");
- }
-
- result = BeforeModule (gGlobalsPtr, index, message, prefsHandle, statusRect, statusPort, &runModule);
-
- if (runModule) {
- copy = *statusRect;
- result = (*gCallThroughSdevMain) (message, prefsHandle, ©, statusPort);
- result = AfterModule (gGlobalsPtr, index, message, prefsHandle, statusRect, statusPort, result);
- }
-
- return result;
- }